#ifndef IMG_H_
#define IMG_H_

// By: Jesse Guarascia de Urena
// Image class
// Deals with loading and storing image files

#include <SDL.h>
#include <SDL_image.h>
#include <string>
#include "Rect.h"
#include "Asset.h"
#include "DebugSys.h"

class Img : public Asset
{
private:
	// Image format enumeration
	enum ImgFormat{
		NO_FORMAT,
		BMP,
		PNG
	} format;

	SDL_Surface* sur; // Surface the img contains
	std::string imageLoc; // Location of the image

public:
	Img(void);
	~Img(void);

	bool LoadImg(std::string fileLoc); // Load a file
	void SetImg(SDL_Surface *_sur); // Create the surface using another surface

	void DeleteImg(); // Delete an image file

	// Get size properties of the image
	inline int Width() { return sur->w; }
	inline int Height() { return sur->h; }

	inline SDL_Surface *GetImage() { return sur; } // Get the image file
	SDL_Surface *GetClippedImage(Rect rect); // Get a specific area of the image
	static SDL_Surface *GetPaddedImage(SDL_Surface *image, Rect paddingRect);

	inline ImgFormat Format() { return format; } // Get the format of the image file

	std::string Debug(); // Debug the file
};

#endif // IMG_H_
